package com.music.lib.qianqian.support;

/**
 * Jsoup Element support
 */
public class Element extends Document{

    Element(Object element){
        super(element);
    }

    public String text(){
        if(document == null) return null;
        try {
            return (String)document.getClass().getMethod("text",null).invoke(document,null);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

    public String attr(String p){
        if(document == null) return null;
        try {
            return (String)document.getClass().getMethod("attr",new Class<?>[]{String.class}).invoke(document,p);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
